import request from "@/utils/request"

// 退款原因列表
export const getReasonList = (params) =>
  request({
    url: `/order/refund/reason/list`,
    method: "get",
    params,
  })

// 新增退款原因
export const apiCreateReason = (data) =>
  request({
    url: `/order/refund/reason/create`,
    method: "post",
    data,
  })

// 退款原因选项
export const getReasonOptions = (params) =>
  request({
    url: `/order/refund/reason/options`,
    method: "get",
    params,
  })

// 删除退款原因
export const destroyRefund = (data) =>
  request({
    url: `/order/refund/reason/destroy`,
    method: "post",
    data,
  })

// 修改退款原因
export const updateRefundReason = (data) =>
  request({
    url: `/order/refund/reason/update`,
    method: "post",
    data,
  })

// 批量修改退款原因状态
export const reasonSwitchStatus = (data) =>
  request({
    url: `/order/refund/reason/switchStatus`,
    method: "post",
    data,
  })

// 订单退款预览
export const getRefundOverflow = (params) =>
  request({
    url: `/order/refund/overflow`,
    method: "get",
    params,
  })

// 添加退款
export const createRefund = (data) =>
  request({
    url: `/order/refund/create`,
    method: "post",
    data,
  })

// 修改退款
export const updateRefund = (data) =>
  request({
    url: `/order/refund/update`,
    method: "post",
    data,
  })

// 退款单详情
export const refundDetail = (params) =>
  request({
    url: `/order/refund/detail`,
    method: "get",
    params,
  })

// 退款审核
export const refundReview = (data) =>
  request({
    url: `/order/refund/review`,
    method: "post",
    data,
  })

// 批量api退款
export const refundRequest = (data) =>
  request({
    url: `/order/refund/request`,
    method: "post",
    data,
  })

// 订单列表
export const getOrderList = (data) =>
  request({
    url: `/order/list`,
    method: "post",
    data,
  })
